API Documentation
Mesh.h
1 // Mesh.h
3 //
5 
6 namespace nkGraphics
7 {
14  class DLL_GRAPHICS_EXPORT Mesh : public Resource, public nkExport::Exportable
15  {
16  public :
17 
21  Mesh () ;
25  virtual ~Mesh () ;
26 
31  void resetCpuBuffers () ;
32 
43  void computeBounds () ;
44 
48  virtual int getVertexBufferCount () const ;
52  virtual unsigned int getVertexCount () const ;
56  virtual unsigned int getIndexCount () const ;
60  unsigned int getId () const ;
64  bool getPackedBufferReady () const ;
68  bool getAutoComputeBounds () const ;
72  BoundingBox* getBounds () const ;
73 
79  void setVertexCount (int value) ;
85  void setIndexCount (int value) ;
91  void setId (unsigned int value) ;
98  void setPackedBufferReady (bool value) ;
104  void setAutoComputeBounds (bool value) ;
105 
106  // Buffer access : Vertex unpacked
110  VertexComposition::VertexComponent* getCurrentVertexArray () const ;
118  VertexComposition::VertexComponent* getNewVertexArray (unsigned int requestedPointNumber) ;
119 
120  // Buffer access : Vertex packed
124  float* getCurrentVertexPackedArray () const ;
132  float* getNewVertexPackedArray (unsigned int requestedPointNumber) ;
133 
137  unsigned int* getCurrentIndexArray () const ;
145  unsigned int* getNewIndexArray (unsigned int requestedIndexNumber) ;
146 
157 
161  virtual void prepareForGeometryStream () = 0 ;
162 
170  virtual void freeShadowBuffers (bool cleanUnpacked, bool cleanPacked) ;
171 
175  void generateTangent () ;
180 
186  virtual void exportClassToTree (nkExport::Node* rootNode) override ;
192  virtual void importClassFromTree (nkExport::Node* rootNode) override ;
193  } ;
194 }
nkGraphics::Mesh::exportClassToTree
virtual void exportClassToTree(nkExport::Node *rootNode) override
nkGraphics::Mesh::~Mesh
virtual ~Mesh()
nkGraphics::Mesh::getPackedBufferReady
bool getPackedBufferReady() const
nkExport::Exportable
An interface to define objects that can be exported using this component.
Definition: Exportable.h:15
nkGraphics::Mesh::setId
void setId(unsigned int value)
nkGraphics::Mesh::getCurrentVertexArray
VertexComposition::VertexComponent * getCurrentVertexArray() const
nkGraphics::Mesh::getVertexBufferCount
virtual int getVertexBufferCount() const
nkGraphics::BoundingBox
A bounding box. Often used to encompass object's bounds in the world.
Definition: BoundingBox.h:14
nkGraphics::Mesh::setAutoComputeBounds
void setAutoComputeBounds(bool value)
nkGraphics::Mesh::importClassFromTree
virtual void importClassFromTree(nkExport::Node *rootNode) override
nkGraphics::Mesh::getBounds
BoundingBox * getBounds() const
nkGraphics::Mesh::getCurrentVertexComposition
VertexComposition & getCurrentVertexComposition()
nkGraphics::Mesh::getNewVertexPackedArray
float * getNewVertexPackedArray(unsigned int requestedPointNumber)
nkGraphics::Mesh::getNewVertexArray
VertexComposition::VertexComponent * getNewVertexArray(unsigned int requestedPointNumber)
nkGraphics::Mesh::prepareForGeometryStream
virtual void prepareForGeometryStream()=0
nkGraphics::Mesh::getNewIndexArray
unsigned int * getNewIndexArray(unsigned int requestedIndexNumber)
nkGraphics::Mesh::Mesh
Mesh()
nkGraphics::Mesh::getId
unsigned int getId() const
nkExport::Node
A node in the tree structure representing the data to export / import.
Definition: Node.h:42
nkGraphics::Mesh::getVertexCount
virtual unsigned int getVertexCount() const
nkGraphics::VertexComposition
Holds information about the composition of a mesh : the data it offers.
Definition: VertexComposition.h:12
nkGraphics::Mesh::setPackedBufferReady
void setPackedBufferReady(bool value)
nkGraphics::Mesh::getCurrentIndexArray
unsigned int * getCurrentIndexArray() const
nkGraphics::Mesh::generateBinormal
void generateBinormal()
nkGraphics::Mesh::getCurrentVertexPackedArray
float * getCurrentVertexPackedArray() const
nkGraphics::Mesh::setVertexCount
void setVertexCount(int value)
nkGraphics::Mesh::freeShadowBuffers
virtual void freeShadowBuffers(bool cleanUnpacked, bool cleanPacked)
nkGraphics::Resource
Base class for a resource in the component.
Definition: Resource.h:12
nkGraphics::Mesh::setIndexCount
void setIndexCount(int value)
nkGraphics::Mesh::getIndexCount
virtual unsigned int getIndexCount() const
nkGraphics::Mesh::resetCpuBuffers
void resetCpuBuffers()
nkGraphics::Mesh::setVertexComposition
void setVertexComposition(const VertexComposition &compo)
nkGraphics::Mesh::getAutoComputeBounds
bool getAutoComputeBounds() const
nkGraphics
Encompasses all API of component NilkinsGraphics.
Definition: BoundingBox.h:7
nkGraphics::Mesh::generateTangent
void generateTangent()
nkGraphics::Mesh
Holds information about a mesh. Used as a basis to render 3d models.
Definition: Mesh.h:15
nkGraphics::Mesh::fillPackedFromUnpacked
bool fillPackedFromUnpacked()
nkGraphics::Mesh::computeBounds
void computeBounds()